#pragma once
#include "imu_processor.h"
#include "lidar_processor.h"
#include <rclcpp/rclcpp.hpp>

enum BuilderStatus
{
    IMU_INIT,
    MAP_INIT,
    MAPPING
};

class MapBuilder
{
public:
    MapBuilder(Config &config, std::shared_ptr<IESKF> kf, const rclcpp::Logger &logger);
        // 保存地图
    bool saveMap(const std::string& file_path)
    {
        return m_lidar_processor->saveMap(file_path);
    }
    void process(SyncPackage &package);
    BuilderStatus status() { return m_status; }    
    std::shared_ptr<LidarProcessor> lidar_processor(){return m_lidar_processor;}
    CloudType::Ptr getCurrentMap() const
    {
        return m_lidar_processor->getCurrentMap();
    }
private:
    Config m_config;
    BuilderStatus m_status;
    std::shared_ptr<IESKF> m_kf;
    std::shared_ptr<IMUProcessor> m_imu_processor;
    std::shared_ptr<LidarProcessor> m_lidar_processor;
    rclcpp::Logger m_logger; 
};
